var url = '?name=zs&pass=123456'


function getqueryurl(url) {
    let query = {
       
    }
    if(url.indexOf('?') !=-1) {
        const str = url.substr(1)
        const pairs = str.split('&')
        console.log('pairs',pairs)
        // ["name=zs", "pass=123456"]
        for(let i =0; i<pairs.length;i++) {
            var tem = pairs[i].split('=')
            console.log('tem',tem)
            // ["name", "zs"]  ["pass", "123456"]
            query[tem[0]] = tem[1]
        }
    }


    return query
}







getqueryurl('?name=zs&pass=123456')